<p>meh</p>
<div id="example"></div>

<script type ="text/javascript">
txt = "<p>User-agent header: " + navigator.userAgent + "</p>";
document.getElementById("example").innerHTML=txt;
</script>
